home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr48
/
pasclern.zip
/
READDISP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-04-01
|
724b
|
29 lines
PROGRAM read_and_display;
VAR chicken : TEXT;
name_of_file_to_input : STRING[12];
line_count : INTEGER;
big_string : STRING[80];
BEGIN (* main program *)
WRITE('Enter input file name ');
READLN(name_of_file_to_input);
ASSIGN(chicken,name_of_file_to_input);
RESET(chicken);
WRITELN;
WRITELN('Program listing with character count per');
WRITELN('line and total line count');
WRITELN;
line_count := 0;
WHILE NOT eof(chicken) DO
BEGIN;
READLN(chicken,big_string);
WRITELN(length(big_string):5,' ',big_string);
line_count := line_count + 1;
END;
CLOSE(chicken);
WRITELN;
WRITELN('The line count is ',line_count:3);
END. (* of program *)